package edu.ccut.saturn.basevalidate.prvalidate;

import edu.ccut.saturn.component.DefaultSaturnValidate;
import edu.ccut.saturn.component.ValidateResult;

public class IsPositiveIntegerValidate extends DefaultSaturnValidate {

	private static final String positiveIntRegExpr = "^[1-9]\\d*$";//[0-9]+

	public void doValidate(Object value, Object[] args, ValidateResult result) {
		if (value != null) {
			if (!(value.toString()).matches(positiveIntRegExpr)) {
				sendError(_ERROR_, value, result);
			}
		}
	}
}
